<?php
 
set_time_limit(0);
ini_set("display_errors", "On");
error_reporting(E_ALL);
 
 
include '../c/config.php';

$mysqli = new mysqli($dbhost, $dbuser, $dbpwd, 'klnm');
if (!$mysqli->set_charset("utf8")) {printf("Error loading character set utf8: %s\n", $mysqliTwo->error);}
 
$sql="SELECT openid,createtime FROM `jpin` WHERE `zlei` = 3 ";
$query =$mysqli->query($sql);
$index=2;
while ($list=$query->fetch_array()){
  
        $queryCard=$mysqli->query("SELECT id FROM `download` WHERE `openid`='".$list['openid']."' limit 0,1 ");
        if($queryCard->num_rows>0){ }else{
            $mysqli->query("INSERT INTO `download` (`id`, `openid`, `idcard`, `createtime`) VALUES (NULL, '".$list['openid']."', NULL, '".$list['createtime']."')");
        }
        
}
 
 